<?php
$q=$_GET["q"];
$array= explode(",",$q);
$desi=$array[0];
$School_Id=$array[1];
$Access_Type=$array[2];
$Id=$Access_Type.",".$School_Id.",School_Id";
$hint="";
include_once '../Login/databaseconnection.php';
if($desi!="Select One"&&$School_Id!="")
{
$n_a_c=mysql_query("SELECT * FROM non_acadamic_staff WHERE Designation='$desi' AND School_Id='$School_Id'");
if($n_a_c)
{
if($rown_a_c=mysql_fetch_array($n_a_c))
{
$No_Of_Required_Staffs=$rown_a_c['No_Of_Required_Staffs'];
$No_Of_Approved_Staffs=$rown_a_c['No_Of_Approved_Staffs'];
$No_Of_Permanent_Staffs=$rown_a_c['No_Of_Permanent_Staffs'];
$No_Of_Casual_Staffs=$rown_a_c['No_Of_Casual_Staffs'];
$Relief=$rown_a_c['Relief'];
$Tot_Staff=$No_Of_Permanent_Staffs+$No_Of_Casual_Staffs;
}
else
{
$No_Of_Required_Staffs='0';
$No_Of_Approved_Staffs='0';
$No_Of_Permanent_Staffs='0';
$No_Of_Casual_Staffs='0';
$Relief='_';
$Tot_Staff='0';
}
}
$hint=$hint.'<table height="175" class="imgholder"> 
         <tr>
        <th> <label>Number of '.$desi.'s:</label></th>
         <td>';
$hint=$hint."<input type='text' name='Tot_Staff' value='$Tot_Staff' readonly='readonly' onmouseover='clearpopbox()'/>";
$hint=$hint.'</td>
         </tr>   
       <tr>
        <th>        
         <label>Number of Required Staffs:</label>
         </th>
         <td>';
         $hint=$hint."<input type='text' name='No_Of_Required_Staffs' value='$No_Of_Required_Staffs' readonly='readonly' onmouseover='clearpopbox()'/>";
$hint=$hint.'</td>
         </tr>         
         <tr>
        <th>        
         <label>Number of Approved Staffs:</label>
         </th>
         <td>';
        $hint=$hint."<input type='text' name='No_Of_Approved_Staffs' value='$No_Of_Approved_Staffs' readonly='readonly'/>";
$hint=$hint.'</td>
         </tr>
         <tr>
        <th>        
         <label>Number of Permanent Staffs:</label>
         </th>
         <td>';
$hint=$hint."<input type='text' name='No_Of_Permanent_Staffs' value='$No_Of_Permanent_Staffs' readonly='readonly' onmouseover='clearpopbox()'/>";
$hint=$hint.'</td>
         </tr>
		 <tr>
        <th>        
         <label>Number of Casual Staffs:</label>
         </th>
         <td>';
$hint=$hint."<input type='text' name='No_Of_Casual_Staffs' value='$No_Of_Casual_Staffs' readonly='readonly' onmouseover='clearpopbox()'/>";
$hint=$hint.'</td>
         </tr>   
       <tr>
	   <tr>
        <th>        
         <label>Relief:</label>
         </th>
         <td>';
$hint=$hint."<input type='text' name='Relief' value='$Relief' readonly='readonly' onmouseover='clearpopbox()'/>";
$hint=$hint.'</td>
         </tr>   
       <tr></table>';
}
if($hint=="")
{
if($School_Id=="")
{
$response="<font color='red'>*Please select a school!</font>";
}
$response=$response.'<table height="175" class="imgholder"> 
         <tr>
        <th> <label>Number of '.$desi.':</label></th>
         <td>';
		 $response=$response."<input type='text' name='Tot_Staff' value='' readonly='readonly'/>";
$response=$response.'</td>
         </tr>   
       <tr>
        <th>        
         <label>Number of Required Staffs:</label>
         </th>
         <td>';
         $response=$response."<input type='text' name='No_Of_Required_Staffs' value='' readonly='readonly'/>";
$response=$response.'</td>
         </tr>         
         <tr>
        <th>        
         <label>Number of Approved Staffs:</label>
         </th>
         <td>';
        $response=$response."<input type='text' name='No_Of_Approved_Staffs' value='' readonly='readonly'/>";
$response=$response.'</td>
         </tr>
         <tr>
        <th>        
         <label>Number of Permanent Staffs:</label>
         </th>
         <td>';
         $response=$response."<input type='text' name='No_Of_Permanent_Staffs' value='' readonly='readonly'/>";
$response=$response.'</td>
         </tr>
		 <tr>
        <th>        
         <label>Number of Casual Staffs:</label>
         </th>
         <td>';
         $response=$response."<input type='text' name='No_Of_Casual_Staffs' value='' readonly='readonly'/>";
$response=$response.'</td>
         </tr>   
       <tr>
	   <tr>
        <th>        
         <label>Relief:</label>
         </th>
         <td>';
         $response=$response."<input type='text' name='Relief' value='' readonly='readonly'/>";
$response=$response.'</td>
         </tr>   
       <tr></table>';
}
else
{
$response=$hint;
}
echo $response;
?>